package string01;

public class IndexOfDemo {
    public static void main(String[] args) {
        String str = "123741852654963789";
        int num1 = str.indexOf("3");
        System.out.println(num1);
        int num2 = str.indexOf("3",3);
        System.out.println(num2);
        int num3 = str.lastIndexOf("3");
        System.out.println(num3);
        int num4 = str.indexOf("0");
        System.out.println(num4);































        /*String str="thinking in java";
        int index=str.indexOf("in");
        System.out.println(index);
        index=str.indexOf("in",3);
        System.out.println(index);
        index =str.indexOf("abc");
        System.out.println(index);
        index=str.lastIndexOf("in");
        System.out.println(index);*/
    }
}
